import java.util.ArrayList;


public class InternetContact implements ContactData {
	String url;
	ArrayList<String> mail;
	
	InternetContact(){
		this ("");
	}
	InternetContact(String u){
		this(u, "");
	}
	InternetContact(String u, String... m){
		mail = new ArrayList<String>();
		for (String k : m)
			mail.add(k);
		url = u;
	}
	public int getLineCount() {
		return mail.size()+1;
	}
	@Override
	public String getLine(int index) {
		if (index == 0)
			return url;
		return mail.get(index-1);
	}

	@Override
	public void sendMessage(String msg) {
		System.out.println("No SMTP Server! \"" + msg+ "\"");
	}
	
	public String toString(){
		String s ="\t* " + url ;
		for (String i : mail)
			s +="\n\t* " + i;
		return s;
	}
	
	public InternetContact add(String m){
		mail.add(m);
		return this;
	}
	public InternetContact setURL(String u){
		url = u;
		return this;
	}

}
